<?php
namespace Admin\Model;
use Think\Model;

//竞赛基础信息表
class JsBaseModel extends Model {
	public function getNameById($_id){
		$re		=		$this->field("name")
						->where("id = '{$_id}'")
						->find();
		return $re['name'];
	}

	//参赛类别_index
	public function getCslbIndex(){
		$_where = "pid > 0 and type = 'cslb'";
		$re		= 		$this->field("id,name")
						->where($_where)
						->order("sort desc,id desc")
					->select();
		return $re;
	}

	//参赛项目_index
	public function getCsxmIndex(){
		$_where = "pid > 0 and type = 'csxm'";
		$re		= 		$this->field("id,name")
			->where($_where)
			->order("sort desc,id desc")
			->select();
		return $re;
	}

	//实验室信息_index
	public function getSysxxIndex(){
		$_where = "pid > 0 and type = 'sysxx'";
		$re		= 		$this->field("id,name")
			->where($_where)
			->order("sort desc,id desc")
			->select();
		return $re;
	}
}